package com.gong.DesignPattern.MementoPattern;

/**
 * @author GongChang
 * @version 1.0
 * @date 2021/7/2 0002 8:55
 */
public class Test {

    public static void main(String[] args) {
        History<Beifen> history = new History<>();
        Document document = new Document();

        document.change("#11");
        history.add(document.save());

        document.change("#22");
        history.add(document.save());

        document.change("#33");
        history.add(document.save());

        System.out.println(document.getCode());

        document.resume(history.get());

        System.out.println(document.getCode());
    }
}
